Intelligent saturation of video data

ABSTRACT

The intelligent saturation controller calculates the exact maximum saturation any valid YCbCr pixel can undergo before it becomes invalid in RGB space. The controller models the saturation operation in RGB color space and calculates the maximum saturation level at which the RGB values falls outside the valid range. The saturation operation is performed independently for every pixel of the incoming video frame and ensures that each output pixel is a valid. The controller finds the maximum saturation for each input pixel and checks whether it is less than the input saturation factor. If so, then this calculated maximum saturation value is applied. If not, the input saturation factor is applied. Accordingly, the output RGB pixels are valid, and no clamping is necessary if no other video processing is done in YCbCr space. Increasing the saturation of the video signal results in a more vivid and more colorful picture.

CROSS REFERENCE TO RELATED APPLICATION

This application is a continuation of U.S. patent application Ser. No. 11/295,882, filed Dec. 7, 2005, which is incorporated herein by reference in its entirety.

FIELD OF THE INVENTION

The present invention relates generally to image and video processing, and more particularly to saturation of color in image signals.

BACKGROUND OF THE INVENTION

For video applications, the YCbCr format is typically used because it is the industry standard for video transmission and storage. The YCbCr format is also typically easier to convert to and from RGB than from HSV. The ease in conversion is important because the final display is usually configured to accept data in RGB format. Increasing the saturation of a video signal results in a more vivid, and hence a more colorful picture. However, increasing the saturation of a YCbCr pixel is a processing step that is very prone to generating blatantly invalid pixels which result in invalid RGB values (and potentially visually annoying artifacts).

An appreciation of the present invention and its improvements can be obtained by reference to the accompanying drawings, which are briefly summarized below, to the following detailed description of illustrated embodiments of the invention, and to the appended claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of an example intelligent saturation controller for increasing saturation.

FIG. 2 is a block diagram of an example intelligent controller for decreasing saturation.

FIG. 3 is an example illustration of a valid space of YUV vectors in an 8-bit system.

FIG. 4 is an example illustration of the effect of video saturation on an RGB color vector.

FIG. 5 is another example illustration of the effect of video saturation on an RGB color vector.

FIG. 6 shows an example of de-saturating an invalid pixel. The invalid pixel has one or more of its RGB values outside the 8-bit valid range.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

In the following detailed description of exemplary embodiments of the invention, reference is made to the accompanied drawings, which form a part hereof, and which is shown by way of illustration, specific exemplary embodiments of which the invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice the invention, and it is to be understood that other embodiments may be utilized, and other changes may be made, without departing from the spirit or scope of the present invention. The following detailed description is, therefore, not to be taken in a limiting sense, and the scope of the present invention is defined only by the appended claims.

Throughout the specification and claims, the following terms take the meanings explicitly associated herein, unless the context clearly dictates otherwise. The meaning of “a,” “an,” and “the” includes plural reference, the meaning of “in” includes “in” and “on.” The term “connected” means a direct electrical connection between the items connected, without any intermediate devices. The term “coupled” means either a direct electrical connection between the items connected, or an indirect connection through one or more passive or active intermediary devices. The term “circuit” means either a single component or a multiplicity of components, either active and/or passive, that are coupled together to provide a desired function. The term “signal” means at least one current, voltage, or data signal. Referring to the drawings, like numbers indicate like parts throughout the views.

The present invention is directed to an intelligent saturation controller that calculates the exact maximum saturation any valid YCbCr (or more generally, any RGB) pixel can undergo before it becomes invalid in RGB space. The controller models the saturation operation in RGB color space and calculates the maximum saturation level at which the RGB values falls outside the valid range. The saturation operation is performed independently for every pixel of the incoming video frame and ensures that each output pixel is a valid. The intelligent saturation controller approach can be used at various stages of the video processing pipeline such as increase of video saturation for picture enhancement and correction of invalid pixels that arise due to other processing.

Various embodiments as discussed below can be incorporated into a video processing system such as described in U.S. patent application Ser. No. 11/296,185 filed Dec. 7, 2005, entitled “Color Management Unit,” the disclosure of which is expressly incorporated herein by reference.

The intelligent saturation controller approach can be used in two directions to check RGB values to make sure they are remaining valid for any given saturation factor. First, intelligent saturation can be used to increase saturation to make images look more vivid, without causing side-effects of clipping or hue shifts. Secondly, intelligent saturation can be used as a gamut-remapping algorithm that decreases saturation to make the image fit within the given gamut.

The controller finds the maximum saturation for each input pixel and checks whether it is less than a predetermined saturation factor (e.g., an amount of saturation adjustment that is desired). If so, then this calculated maximum saturation value is applied. If not, the predetermined saturation factor is applied. Accordingly, the output RGB pixels are valid and no clamping is necessary if no other video processing is done in YCbCr space. Increasing the saturation of the video signal results in a more vivid and more colorful picture.

FIG. 1 is a block diagram of an example intelligent saturation controller for increasing saturation. The intelligent saturation controller (100) comprises a saturation evaluation unit (110) and a saturation processor (120). The example intelligent controller (100) calculates a maximum saturation for any YCbCr pixel that remains valid in RGB space. The calculation is accomplished by modeling the saturation operation in RGB color space and calculating the maximum saturation at which one of the RGB values falls outside the valid range.

The calculation (described below with reference to FIG. 5, for example) is typically performed independently for every pixel of the incoming video frame to ensure that each output pixel is valid in RGB space. The intelligent saturation controller finds the maximum saturation for each input pixel and verifies whether the input pixel is less than the predetermined saturation factor. If so, then this calculated maximum saturation value is applied. If not, the predetermined saturation factor is applied. In the proposed system, the output RGB pixels are guaranteed to be valid and no clamping is necessary if no other video processing is done in YCbCr space (this can be ensured by placing the color management unit at the back-end of the video processing pipeline.) Converter 130 converts YCbCr pixels to RGB pixels.

FIG. 2 is a block diagram of an example intelligent controller for decreasing saturation. The intelligent saturation controller (200) comprises a YCbCr-to-RGB converter (210) and a desaturation processor (220). In operation, the intelligent saturation controller can “correct” invalid pixels by desaturating the invalid pixels. To correct (rather than to merely clamp) invalid RGB pixels, the intelligent saturation controller calculates (described below with reference to FIG. 6, for example) the amount of desaturation needed to place invalid pixels within a valid range. In an embodiment, the desaturation is directly applied to RGB pixels instead of saturating pixels within YCbCr space. Valid pixels are typically unmodified. To represent the invalid pixels, the output data of the color space converter uses a higher resolution than the input. After the desaturation procedure, the original resolution is maintained.

Enhancement of video data is performed in all modern displays and video processing equipment. Video is usually transmitted and processed in YCbCr color space due to a number of reasons such as lower bandwidth and separation of brightness and color information. However, most display panels use RGB as their input data format. Because RGB input is commonly used as the input format, the YCbCr data is converted to RGB-formatted data at some stage of the video processing pipeline.

The conversion to RGB is done using a set of linear equations that calculate R, G and B given Y, Cb and Cr. The problem that arises during this conversion is that any valid YCbCr triplet (say 24 or 30 bits) does not always map to a valid RGB triplet (assuming the same number of bits). Processing and enhancement of YCbCr data may transform a valid YCbCr pixel into an invalid one (a valid YCbCr pixel is one that maps to a valid RGB pixel). Conventional conversion mechanisms typically clamp the invalid RGB values to the extremes of their valid range, which often leads to visual anomalies in the output signal. A disadvantage of clamping is that brightness and hue of the pixel are not preserved, and a loss of details and patchiness are present in the output picture.

The YCbCr color space is typically used for contrast enhancement because the luminance and color information are separate and can be processed independently. The YCbCr color space is also one of the common video exchange formats that is currently used. “Y” is the luminance (usually referred to as luma) of the video while “Cb” and “Cr” are the chroma or color components. Another advantage of transmitting signals in YCbCr format is that the bandwidth of the signal can also be reduced by down-sampling the chrominance signals. Down-sampling is visually acceptable because the human vision system is typically more sensitive to brightness than to color. Y, Cb and Cr are usually assigned values ranging from 0 to 255 in an 8-bit system.

When an offset of 128 is removed from Cb and Cr, the YCbCr space is referred to as the YUV space. In YUV space, U and V range from −128 to 127. The value U is the offset removed representation of Cb and V is the offset removed representation of Cr. Although transmission of video data is often more convenient in YCbCr form (due to the unsigned nature of data), most color enhancement operations are usually defined in terms of the U and V components. For example, the location of the UV vector determines the hue of the color of a pixel. The three primary colors red, green and blue and their complementary colors yellow, magenta and cyan are spaced out circularly in the U-V plane with a separation of approximately 60°.

Data in RGB format can be converted to YUV using a set of linear equations such as:

$\begin{matrix} {\begin{pmatrix} Y \\ U \\ V \end{pmatrix} = {\begin{bmatrix} 0.299 & 0.587 & 0.114 \\ {- 0.172} & {- 0.339} & 0.511 \\ 0.511 & {- 0.428} & {- 0.083} \end{bmatrix}\begin{pmatrix} R \\ G \\ B \end{pmatrix}}} & (1) \end{matrix}$ where R, G, B and Y range from 0 to 255 while U and V range from −128 to 127. In the following example system, an 8-bit system is demonstrated.

The conversion coefficients in equation (1) are specified by the ITU-601 specification (SDTV) video standard. The inverse equation is used to convert YUV signals into an RGB format as follows:

$\begin{matrix} {\begin{pmatrix} R \\ G \\ B \end{pmatrix} = {\begin{bmatrix} 1 & 0 & 1.371 \\ 1 & {- 0.698} & {- 0.336} \\ 1 & 1.732 & 0 \end{bmatrix}\begin{pmatrix} Y \\ U \\ V \end{pmatrix}}} & (2) \end{matrix}$

When an RGB pixel is converted to a YUV pixel, the valid signal space is compressed. Namely, while every valid n-bit RGB vector maps to a valid n-bit YUV vector, the converse is not true. This can be seen by inspection of the YUV to RGB transformation equations (2). When Y, U and V are all at their maximum values for example (Y is 255 and U and V are 127), the resulting R and B values exceed 255.

The compression of the valid pixel range is significant because if data for an input YUV pixel is valid, video enhancement of the pixel may change the pixel data to the point where the data may no longer be valid. The possibility of the pixel being transformed to an invalid space can substantially affect the quality of video processing algorithms that are usually performed on YUV data. Examples of such processing include deinterlacing, noise removal, sharpening, and color and contrast enhancements. Increasing the saturation of YUV data is particularly prone to generation of invalid data.

FIG. 3 is an example illustration of a valid space of YUV vectors in an 8-bit system. The figure illustrates a valid space of YUV vectors is a cuboid shaped region (310) inside the cube of 8-bit YUV values (300). The figure shows that the identification of valid YUV data is relatively computationally intense. Prediction of when valid YUV vectors become invalid can be even more complex.

Enhancing the color of an incoming video data stream is one of the most commonly used enhancement procedures in consumer electronics. This can be done by increasing the saturation of the video data using the following equation:

$\begin{matrix} {\begin{pmatrix} U_{out} \\ V_{out} \end{pmatrix} = {\begin{bmatrix} {sat} & 0 \\ 0 & {sat} \end{bmatrix}\begin{pmatrix} U_{in} \\ V_{in} \end{pmatrix}}} & (3) \end{matrix}$ Increasing the saturation is relatively simple—the input U and V values are multiplied by some saturation factor sat.

With respect to the U-V axis, changing the saturation can be visualized as moving the input [u v]^(t) vector along a line through the origin and the original point. If sat is zero, the output point is [0 0]^(t). An output point of [0 0]^(t) corresponds to a black and white or gray level picture and having chroma components that are zero. If sat is greater than one, the input point is shifted away from the origin. In this case, the output point becomes more vivid or colorful than the original. Because increase of saturation changes the chroma components significantly, the output chroma point is susceptible to falling outside the valid YUV cuboid.

To increase the saturation of YUV vectors while keeping them valid, it is instructive to study the effect of saturation increase in the RGB color space. Using the color space conversion and saturation equations presented above, the effect of video saturation on RGB color points can be translated using equation (4): R _(out) =satx(R _(in) −Y)+Y G _(out) =satx(G _(in) −Y)+Y B _(out) =satx(B _(in) −Y)+Y  (4) Equation (4) can be derived as follows:

$\begin{matrix} R_{out} & = & {Y + {1.371V_{out}}} & {{using}\mspace{14mu}{Equation}\mspace{14mu}(2)} \\ \; & = & {Y + {1.371{satV}_{in}}} & {{using}\mspace{14mu}{Equation}\mspace{14mu}(3)} \\ \; & = & {Y + {1.371{{sat}\left( {{0.511R_{in}} - {0.428G_{in}} - {0.083B_{in}}} \right)}}} & {{using}\mspace{14mu}{Equation}\mspace{14mu}(1)} \\ \; & = & {Y + {{sat}\left( {{0.701R_{in}} - {0.587G_{in}} - {0.114B_{in}}} \right)}} & \; \\ \; & = & {Y + {{sat}\left( {R_{in} - {0.299R_{in}} - {0.587G_{in}} - {0.114B_{in}}} \right)}} & \; \\ R_{out} & = & {Y + {{sat}\left( {R_{in} - Y} \right)}} & {{using}\mspace{14mu}{Equation}\mspace{14mu}(1)} \end{matrix}$ While the equations are linear transformations of the RGB vector, there is still a dependence on the luminance Y.

FIG. 4 is an example illustration of the effect of video saturation on an RGB color vector. The horizontal axis (410) represents the saturation factor, and the vertical axis (420) represents the RGB values. When sat is zero, the RGB values converge to the value of Y (approximately 150 in this example). As sat increases from 0, the RGB values vary in a straight-line fashion. The slopes of the red (430), green (440) and blue (450) lines depend on the hue of the color point, and (as just mentioned) the intersection of the red, green and blue lines with the y-axis depends on the luminance of the color point.

In the Figure, the x-axis of saturation factor is calibrated with the original RGB values of the color point plotted with respect to sat of 1, and the luminance value plotted with respect to sat of 0. Smooth lines are drawn from the luminance value through each of the original R, G and B values to illustrate the three lines that represent the variation of red, green and blue values respectively.

From FIG. 4, it can be seen that if the saturation is increased arbitrarily, then one or more of the red, green and blue lines approach 0 or 255. The hue of the color determines the slopes of these lines and thus determines which line would reach 0 or 255 first. As long as the RGB values are within the 0-255 range the color point can be saturated further and appears more colorful and vivid. However, the saturation cannot be increased further beyond the point where one of the RGB lines hit 0 or 255. If saturation is increased further, the resulting RGB point is invalid.

In the example, the resulting RGB point occurs when the red line (430) reaches the value 255. Even though the blue (440) and green (450) lines continue to vary in a linear fashion, the red line remains at the value 255. As the saturation is increased further, the blue reaches the value of 0 and remains there (along with red at 255) as green continues to change. Accordingly, the saturation increase should be stopped as soon as one color reaches the boundary of its range.

If the saturation continues beyond the maximum saturation point, the resulting color point undergoes a change of brightness and hue. The resulting picture has artifacts such as unnatural change in colors, loss of details etc. The effect of saturating the equivalent YUV point can be visualized as a shift of the point beyond the boundaries of the valid YUV cuboid (310). Although finding the boundaries of the valid YUV cuboid is a computationally expensive task, the problem of restricting the saturation can be easier to implement in the RGB domain.

FIG. 5 is another example illustration of the effect of video saturation on an RGB color vector. The original RGB values r (510), g (520) and b (530) are given for a pixel, which correspond to a saturation increase of 1. The luma value y can be calculated using the color space conversion equations above. The calculated luma value corresponds to a sat of 0. The intelligent saturation controller determines the maximum saturation (maxsat) the pixel can undergo before one of r, g or b is invalid. In this case, maxsat is the saturation at which red becomes 0.

To determine the maximum saturation, the equations of two lines are examined: the line through y and the maximum of r, g and b, and the line through y and the minimum of r, g and b. The saturation (sat₁) at which the first line reaches 255, and the saturation (sat₂) at which the second line reaches the value 0 are calculated. The lesser of sat₁ and sat₂ is chosen to be maxsat.

Let bgr_(max)=max(b, g, r) and bgr_(min)=min(b, g, r). From analytical geometry:

$\begin{matrix} {{sat}_{1} = {{\frac{255 - y}{{bgr}_{\max} - y}\mspace{14mu}{and}\mspace{14mu}{sat}_{2}} = {\frac{y}{y - {bgr}_{\min}}\mspace{14mu}{such}\mspace{14mu}{that}}}} & (5) \\ {{maxsat} = {{\min\left( {{sat}_{1},{sat}_{2}} \right)} = {\min\left( {\frac{255 - y}{{bgr}_{\max} - y},\frac{y}{y - {bgr}_{\min}}} \right)}}} & (6) \end{matrix}$

Using Equation (6), each frame of the incoming video signal can be saturated by calculating the maximum saturation of each pixel of the frame and constraining the amount of saturation applied such that it equals or falls below that maximum value. For example, if it is desired to saturate a picture by a factor of 2, each pixel of the frame is examined to see whether its individual maxsat is greater than two. If the maxsat of a particular pixel is greater than two, then this pixel can be saturated by two without any artifacts. If however, its maxsat is less than two, say 1.75, then this pixel is saturated by 1.75 only.

Thus each pixel may be saturated to a different extent depending on its maxsat value, which in turn depends on its RGB values. When the incoming pixels are YUV, they are first converted to RGB to determine their maximum saturation values. The actual increase of saturation can be done in either YUV or RGB domains using the equations presented earlier.

An example algorithm for intelligent saturation of video signals is:

For each incoming pixel do:

-   -   1. If the incoming pixel is YUV, find the corresponding RGB         values. They correspond to sat of 1     -   2. If the incoming pixel is RGB, find its luminance. This is the         RGB value for a sat of 0     -   3. Calculate bgr_(max) and bgr_(min)     -   4. Use the above values to calculate sat₁, sat₂ and hence maxsat     -   5. Let insat be the input or desired saturation, and outsat be         the output saturation value to be computed as         -   a. If insat is less then or equal to maxsat, let             outsat=insat         -   b. If insat is greater than maxsat, let outsat=maxsat     -   6. Calculate the output color point using either the RGB or YUV         saturation equations with outsat as the saturation factor

The example algorithm is relatively simple to implement in hardware. The division can be computed using an 8-bit deep lookup table. Notwithstanding the lookup table, no large memory elements are required.

Many digital video processing tasks are performed in the YCbCr domain since they are well defined in this color space. During the course of video processing, pixels that were valid RGB pixels may be shifted out of the valid YUV cuboid. Usually when these pixels are converted back to RGB, the RGB values are clamped to 0 and 255. A similar situation exists when RGB values are mapped to conform to different display devices that have different color gamuts using transformations such as those specified by the sRGB standard. In such situations, an input RGB point is often mapped to an output RGB point that falls outside the 0-255 range.

“Correcting” an invalid pixel by de-saturating the pixel until it falls within the 0-255 range ensures the output pixel value maintains the same brightness and hue as the transformed but invalid pixel. The method of de-saturation operates in accordance with the method of intelligently increasing the saturation as described above.

FIG. 6 shows an example of de-saturating an invalid pixel. The invalid pixel has one or more of its RGB values outside the 8-bit valid range. Graph 600 shows that the value for r is less than 0. The invalid pixel corresponds to a sat of 1, while its luma value y corresponds to a sat of 0. The problem is to determine the value of de-saturation required, desat, that brings the pixel into valid range. The value of desat ranges from 0 to 1. The method to compute desat can use the same equations that were used to compute maxsat, as in Equation (6) above.

Once desat has been computed, the invalid pixel can be de-saturated using the saturation equations shown earlier. As with the computation of maxsat, desat must be computed on a pixel-by-pixel basis, obviously for invalid pixels only. But since the RGB values of an invalid pixel are outside the 0-255 range, the depth of the division LUT will now be greater than 8 bits and the size of the multipliers would now be increased.

Various embodiments of the invention are possible without departing from the spirit and scope of the invention. The above specification, examples and data provide a complete description of the manufacture and use of the composition of the invention. For example, the architecture can be implemented using hardware, software, or a combination of both. Also, different bit depths can be used for the calculations as describe above. Although described embodiments are described as having a 0-255 range (since 8-bits per sub-pixel is the most common bit depth used for mainstream displays), other ranges can be used, including a 10 bit range (0-1023) or 12 bit range (0-4095) or any other bit depth. Additionally, subsets of ranges (such as 16-256) can be used as well. Since many embodiments of the invention can be made without departing from the spirit and scope of the invention, the invention resides in the claims hereinafter appended. 

1. A method comprising: determining that a pixel of an image frame is an invalid pixel; determining a desaturation factor that will correct the invalid pixel such that brightness and hue of the invalid pixel is preserved; and adjusting color component values of the invalid pixel by the desaturation factor such that all the color component values of the invalid pixel are adjusted into a valid range, wherein the desaturation factor is based on a minimum of (I) a first saturation value based on a first color component value of the invalid pixel, and (2) a second saturation value based on a second color component value of the invalid pixel.
 2. The method of claim 1, wherein the first saturation value and second saturation value are further based on a luminance value of the invalid pixel.
 3. The method of claim 2, wherein the first saturation value and second saturation value are further based on a linear relationship between at least one color component value of the invalid pixel and the luminance value.
 4. The method of claim 1, wherein the first color component value is a minimum color component value of the invalid pixel.
 5. The method of claim 1, wherein the second color component value is a maximum color component value of the invalid pixel.
 6. The method of claim 1, further comprising increasing a resolution of the invalid pixel.
 7. The method of claim 6, wherein the color component values of the invalid pixel are adjusted while the invalid pixel is at the increased resolution.
 8. The method of claim 6, further comprising decreasing the resolution of the invalid pixel after the color component values are adjusted into a valid range.
 9. The method of claim 1, wherein the desaturation factor is found in according with the equation: ${{desat} = {{\min\left( {{{sat}\; 1},{{sat}\; 2}} \right)} = {\min\left( {\frac{255 - y}{{bgr}_{\max} - y},\frac{y}{y - {bgr}_{\min}}} \right)}}},$ wherein y is a luminance value, sat1 is the first saturation value, and sat2 is the second saturation value.
 10. A system comprising: an intelligent saturation controller that is configured to: determine that a pixel of an image frame is an invalid pixel; determine a desaturation factor that will correct the invalid pixel such that brightness and hue of the invalid pixel is preserved; and adjust color component values of the invalid pixel by the desaturation factor such that all the color component values of the invalid pixel are adjusted into a valid range, wherein the desaturation factor is based on a minimum of (I) a first saturation value based on a first color component value of the invalid pixel, and (2) a second saturation value based on a second color component value of the invalid pixel.
 11. The system of claim 10, wherein the first saturation value and second saturation value are further based on a luminance value of the invalid pixel.
 12. The system of claim 11, wherein the first saturation value and second saturation value are further based on a linear relationship between at least one color component value of the invalid pixel and the luminance value.
 13. The system of claim 10, wherein the first color component value is a minimum color component value of the invalid pixel.
 14. The system of claim 10, wherein the second color component value is a maximum color component value of the invalid pixel.
 15. The system of claim 10, wherein the intelligent saturation controller is further configured to increase a resolution of the invalid pixel.
 16. The system of claim 15, wherein the color component values of the invalid pixel are adjusted while the invalid pixel is at the increased resolution.
 17. The system of claim 15, wherein the intelligent saturation controller is further configured to decrease the resolution of the invalid pixel after the color component values are adjusted into a valid range.
 18. The system of claim 10, wherein the desaturation factor is found in according with the equation: ${{desat} = {{\min\left( {{{sat}\; 1},{{sat}\; 2}} \right)} = {\min\left( {\frac{255 - y}{{bgr}_{\max} - y},\frac{y}{y - {bgr}_{\min}}} \right)}}},$ wherein y is a luminance value, sat1 is the first saturation value, and sat2 is the second saturation value. 